home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 038a / bas_int1.zip / SCROLL.BAS < prev    next >
BASIC Source File  |  1991-02-02  |  4KB  |  111 lines

  1.     '=================================================================
  2.     '***** Screen Scrolling with Call Interrupt
  3.     'To demonstrate the use of interrupt 10H ah=06
  4.     'To scroll any part of the screen up or down
  5.     'QB must be invoked with the /l switch. In QB.BI the RegType is
  6.     'defined and the INTERRUPT-Call set up.
  7.     'By Johan Lindgren (BBS:+46 60115371)
  8.     '=================================================================
  9.  
  10.     DECLARE SUB scroll.ner (rader!, left!, up!, right!, down!)
  11.     DECLARE SUB scroll.up (rader!, left!, up!, right!, down!)
  12.  
  13.     '$INCLUDE: 'QB.BI'
  14.     
  15.     DIM SHARED inregs AS RegType, outregs AS RegType
  16.     
  17.     '---------------------------------------------------------------------
  18.     ' Fill the screen with numbers to indicate where scrolling takes place
  19.     '---------------------------------------------------------------------
  20.     
  21.     FOR i = 1 TO 24
  22.     FOR j = 1 TO 40
  23.     
  24.     PRINT USING "##"; i;
  25.     
  26.     NEXT j
  27.     NEXT i
  28.     
  29.     '----------------------------------------------------------
  30.     ' Do one scroll up first. Give values and call the sub
  31.     '----------------------------------------------------------
  32.     
  33.     rader = 5: up = 5: left = 19: down = 14: right = 21
  34.     
  35.     scroll.up rader, left, up, right, down
  36.     
  37.     '------------------------------------------------------------
  38.     ' Do a scroll down. Give values and call the sub
  39.     '------------------------------------------------------------
  40.     
  41.     rader = 3: up = 11: left = 35: down = 20: right = 70
  42.     
  43.     scroll.ner rader, left, up, right, down
  44.     
  45.     'END of demo.
  46.     END
  47.  
  48. '=======================================================================
  49. 'SUB Scroll.ner(rader,left,up,right,down)
  50. 'Purpose: To scroll characters on video screen down
  51. 'Useage:  rader = #rows to scroll down
  52. '          left = #columns between left border & scrolling block
  53. '            up = eg, up=n => (n+1)st row scrolled down, and all
  54. '                   rows below will scroll except for protected area
  55. '                   defined by "down"
  56. '         right = eg, right=n => Column (n+1) is right most column
  57. '                   of scrolling block to scroll
  58. '          down = eg, down=n => (25-n-1) bottom rows protected & not
  59. '                   scrolled over.
  60. '=======================================================================
  61. SUB scroll.ner (rader, left, up, right, down)
  62.     
  63.     '-----------------------------------------------------------
  64.     'First put up and down in right hexadecimal postion
  65.     'Then enter the values into the registers and call interrupt
  66.     '------------------------------------------------------------
  67.     
  68.            up = up * 256
  69.            down = down * 256
  70.     
  71.            inregs.ax = &H700 + rader
  72.            inregs.cx = up + left
  73.            inregs.dx = down + right
  74.     
  75.            CALL INTERRUPT(16, inregs, outregs)
  76.     
  77.     END SUB
  78.  
  79. '=======================================================================
  80. 'Purpose: to scroll characters up on CRT
  81. 'Useage:  Scroll.up rader,left,up,right,down
  82. '         where rader = #rows to move up
  83. '               right = right most column of scrolling block to scroll + 1;
  84. '                       eg, right=20 => 21st column will scroll but not 22nd
  85. '               left  = # of columns to left of scrolling block that will
  86. '                        not scroll.
  87. '                 up  = eg, up=n => top n rows are protected and not
  88. '                        scrolled over.
  89. '              down   = eg, down=n => scroll the (n+1)st row up "rader" times
  90. '                        All rows above the (n+1)st row will also scroll up
  91. '                        except for "up" rows.
  92. '=========================================================================
  93. SUB scroll.up (rader, left, up, right, down)
  94.     
  95.     '-----------------------------------------------------------
  96.     'First put up and down in right hexadecimal postion
  97.     'Then enter the values into the registers and call interrupt
  98.     '------------------------------------------------------------
  99.     
  100.            up = up * 256
  101.            down = down * 256
  102.     
  103.            inregs.ax = &H600 + rader
  104.            inregs.cx = up + left
  105.            inregs.dx = down + right
  106.     
  107.            CALL INTERRUPT(16, inregs, outregs)
  108.     
  109.     END SUB
  110.  
  111.